﻿//
// eCRAM, a monthly activity report web application
// Copyright (C) 2010  Aptea
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
//

using eCRAM.Model;

namespace eCRAM.WebSite.Services
{
    /// <summary>
    /// Authenticates a user.
    /// </summary>
    /// 
    /// <remarks>
    /// Instead of relying on Windows authentification system (code generated
    /// we you create a ASP.NET MVC project), we prefer to rely
    /// authentification with our own database, more precisely the user table.
    /// </remarks>
    public interface IAuthenticationService
    {
        /// <summary>
        /// Gets the user given a username/password.
        /// </summary>
        /// 
        /// <remarks>
        /// When a user/visitor logs in the eCRAM application, the visitor should match
        /// a User object.
        /// </remarks>
        /// 
        /// <param name="userName">User login</param>
        /// <param name="password">User password</param>
        /// <returns>The user or null if username/password does not match any user</returns>
        User LogOn(string userName, string password);
    }
}
